
#ifndef SSM_HPP
#define SSM_HPP
class SSM{
	public:
	SSM(double *Y,mat X,int T)
	{
		_Y=Y;
		_X=X;
		_T=T;
	}
	virtual mat rq(mat,mat,int)=0;
	virtual double dq(mat,mat,double,mat)=0;
	virtual double dg(mat,mat,double,mat)=0;
	virtual double df(double,mat,mat)=0;
	virtual mat rm(mat)=0;

	void Weights(double *W,mat Xt, mat Xt1, mat Theta, int t)
	{
		int M=Xt.n_rows;
		for(int i=0;i<M;i++)
		{
			W[i]+=df(_Y[t],Xt(i,span::all),Theta)+dg(Xt(i,span::all),Theta,_Y[t],Xt1(i,span::all))-dq(Xt(i,span::all),Theta,_Y[t],Xt1(i,span::all));
		}
	}
	private:
	mat _X;
	double *_Y;
	double _T;
};
#endif
